<template>
  <div class="xiaobanxin">
    <div class="tanxin gedan_top">
      <div>
        <span>全部</span>
        <el-popover
          placement="bottom-start"
          title="全部分类"
          width="600"
          trigger="manual"
          content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。"
          v-model="visible"
        >
          <el-button slot="reference" @click="visible = !visible"
            >选择分类</el-button
          >
        </el-popover>
      </div>
      <div class="remenzi">热门</div>
    </div>

    <div class="gedan_bou">
      <ul>
        <li v-for="(item, index) in gedan" :key="index">
          <img class="img1" :src="item.coverImgUrl" alt="" />
          <p>{{ item.name }}</p>
          <p>
            <span>by</span>
            <a href="#">{{ item.creator.nickname }}</a>
            <img :src="item.creator.avatarDetail.identityIconUrl" alt="" />
          </p>
        </li>
      </ul>
    </div>
    <div class="block">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage4"
        :page-sizes="[100, 200, 300, 400]"
        :page-size="100"
        layout="total, sizes, prev, pager, next, jumper"
        :total="400"
      >
      </el-pagination>
    </div>
  </div>
</template>

<script>
import { GetgedanApi } from "@/request/api";
export default {
  data() {
    return {
      gedan: [],
      visible: false,
    };
  },
  created() {
    GetgedanApi().then((res) => {
      this.gedan = res.data.playlists;
      console.log(this.gedan);
    });
  },
};
</script>
 
<style lang = "less" scoped>
@import "../../assets/base.less";
.gedan_top {
  height: 50px;
  line-height: 50px;
  border-bottom: 2px solid red;
  span {
    font-size: 18px;
    font-weight: bold;
    margin-right: 10px;
  }
  .remenzi {
    width: 50px;
    height: 30px;
    line-height: 30px;
    margin: auto 10px;
    text-align: center;
    color: white;
    background-color: red;
    &:hover {
      text-decoration: underline;
    }
  }
}
.gedan_bou {
  cursor: pointer;
  overflow: hidden;
  cursor: pointer;
  margin-top: 20px;
  box-sizing: border-box;
  padding: 0 20px;
  ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    li {
      height: 180px;
      margin-bottom: 40px;
      font-size: 14px;
      .img1 {
        width: 140px;
        height: 140px;
        padding-right: 20px;
      }
      p {
        box-sizing: border-box;
        margin-top: 5px;
        width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: wrap;
        a {
          color: black;
          text-decoration: none;
          &:hover {
            text-decoration: underline;
            color: skyblue;
          }
        }
        span {
          padding-right: 5px;
        }
        img {
          width: 10px;
          margin-left: 5px;
        }
      }
    }
  }
}
.tishikuang {
  width: 100%;
  height: 100px;
  z-index: 1;
  background-color: skyblue;
}
</style>